﻿#ifndef BASEMODULE_APPMANAGER_H
#define BASEMODULE_APPMANAGER_H

#include <QObject>
#include "API_BaseModule.h"

class QMainWindow;

#define AppManagerInstance BaseModule::AppManager::getInstance()

namespace BaseModule
{
    class API_BASEMODULE AppManager : public QObject
    {
        Q_OBJECT

    public:
        static AppManager* getInstance()
        {
            static AppManager m_instance;
            return &m_instance;
        }

        void init(QMainWindow* mainWindow);

    private slots:

        void slot_sendQuestionMessageToUI(int& result, const QString& title, const QString& message);

        void slot_sendErrorMessageToUI(const QString& message);

    private:
        AppManager();
        ~AppManager();

        void handleAppClose();

    private:
        QMainWindow* m_mainWindow{};
    };
}
#endif
